HttpServletResponse (Java(TM) EE 7 Specification APIs) 您所在的位置:网站首页 set error method HttpServletResponse (Java(TM) EE 7 Specification APIs)

HttpServletResponse (Java(TM) EE 7 Specification APIs)

2024-07-17 18:55| 来源: 网络整理| 查看: 265

Sets the status code for this response.

This method is used to set the return status code when there is no error (for example, for the SC_OK or SC_MOVED_TEMPORARILY status codes).

If this method is used to set an error code, then the container's error page mechanism will not be triggered. If there is an error and the caller wishes to invoke an error page defined in the web application, then sendError(int, java.lang.String) must be used instead.

This method preserves any cookies and other response headers.

Valid status codes are those in the 2XX, 3XX, 4XX, and 5XX ranges. Other status codes are treated as container specific.



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

      专题文章
        CopyRight 2018-2019 实验室设备网 版权所有